{extend name="template/base_default"}
{block name="header"}
<link rel="stylesheet" href="__CSS__/common.css">
<link rel="stylesheet" href="__CSS__/weui.min.css">
<link rel="stylesheet" href="__CSS__/weuix.min.css">
<link rel="stylesheet" href="__CSS__/jquery-weui.css">
<link rel="stylesheet" href="__CSS__/index.css">
<style>
    .login-form{
        background: white;
    }
    body{
        background-image:url("__IMG__/bj.png");
        background-repeat:no-repeat;
        background-size:cover;
        text-align: center;
    }
</style>
{/block}
{block name="body"}
<div id="personalHeader" onclick="">
    <ul>
        <li><div class="c-logo" ><img class="m-avatar" src="__IMG__/che.png" /></div></li>
    </ul>
</div>
<form action="" method="post" style="width:80%;margin: auto">

    <div class="form-input">
        <input class="weui-input" type="tel" id="phone" placeholder="手机号">
    </div>


    <div class="form-input">
        <input class="weui-input" type="password" id="password" placeholder="请输入密码">
    </div>

    <div class="form-input">
        <a href="{:url('login/register')}" style=" color: white; float: left; margin-top: 10px">注册</a>
        <a href="{:url('login/forgetpw')}" style=" color: white; float: right; margin-top: 10px">忘记密码？</a>
    </div>
    <div class="form-input">
        <button id="submit" class="login-btn" type="button">登录</button>
    </div>

</form>
{/block}
{block name="footer"}
<script type="text/javascript" src="__JS__/public.js"></script>
<script>
    $('#submit').click(function () {

            var body  ={

                mobile:$('#phone').val(),
                password:$('#password').val(),
            };
            var $this = $(this);
            $this.addClass('weui-btn_disabled').attr('disabled','disabled');
            ajax_post(getBaseUrl()+'web.php/login/login',jQuery.param(body),{
                success:function(data){
                    $.toast("登录成功",'success');
                    $this.removeClass('weui-btn_disabled').removeAttr("disabled");
                    setTimeout(
                            function(){
                                window.location.href=getBaseUrl()+'web.php/index/index.html';
                            }
                            ,1500);
                },
                error:function(data){
                    $.toptip(data.data, 'error');
                    $this.removeClass('weui-btn_disabled').removeAttr("disabled");
                }
            })


    });

</script>
{/block}